{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "1.【判断】dir()函数带参数时，返回参数的属性/方法列表；不带参数时，返回搜索路径上定义的所有变量名。（ ）  \n",
    "\n",
    "A. √   \n",
    "B. ×"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "答案：A。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "2.【判断】执行如下代码后，自动被放入变量搜索路径的只有x和y变量。（ ）   \n",
    "```\n",
    "x=1\n",
    "y=2\n",
    "z=x*y```\n",
    "\n",
    "A. √   \n",
    "B. ×"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "答案：B。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "3.【判断】执行如下代码后，系统会报NameError错误。（ ）    \n",
    "```\n",
    "x=1\n",
    "y=2\n",
    "del y\n",
    "z=x*y```\n",
    "A. √  \n",
    "B. ×"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "答案：A。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "4.【判断】加载模块时，解释器在sys.path路径中搜索对应模块的源代码，我们可以利用sys.path()方法查看模块搜索路径。（ ）  \n",
    "\n",
    "A. √  \n",
    "B. ×"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "答案：B。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "5.【判断】sys.path中的第一个条目通常是一个空字符串' '，表示当前正在使用的字典。（ ）\n",
    "\n",
    "A. √  \n",
    "B. ×"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "答案：A。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "6.【判断】请判断如下增添模块搜索路径的方法是否正确。（ ）  \n",
    "```\n",
    "import sys\n",
    "sys.path.append(\"modules1.zip\")\n",
    "sys.path.append(\"/tem/modules2.zip/lib/python\")```\n",
    "A. √  \n",
    "B. ×"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "答案：A。  \n",
    "解析：我们可以将包含Python模块的zip归档文件添加到搜索路径中。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "7.【填空】代码（ ）可以将```“C:\\\\Path”```添加至模块搜索路径，代码（ ）可将其从模块搜索路径中删除。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "答案：```sys.path.append('C:\\\\Path')；sys.path.remove('C:\\\\Path')```"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python [default]",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
